package abstractEntities;

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.MappedSuperclass;
import javax.persistence.OneToMany;
import org.hibernate.annotations.GenericGenerator;

import entities.Departament;
import entities.Itemrecord;
import entities.Languageitem;
import entities.Map;

/**
 * AbstractItens entity provides the base persistence definition of the Itens
 * entity. @author MyEclipse Persistence Tools
 */
@MappedSuperclass
public abstract class AbstractItens implements java.io.Serializable {

	// Fields

	/**
	 * 
	 */
	private static final long serialVersionUID = -2128748531123090840L;
	private Integer idItem;
	private Departament departament;
	private Integer flagVisible;
	private String img2ditem;
	private Integer minLevel;
	private Integer flagPrize;
	private Integer ntimesUse;
	private Integer globalLevel;
	private Set<Languageitem> languageitems = new HashSet<Languageitem>(0);
	private Set<Map> maps = new HashSet<Map>(0);
	private Set<Itemrecord> itemrecords = new HashSet<Itemrecord>(0);

	// Constructors

	/** default constructor */
	public AbstractItens() {
	}

	/** minimal constructor */
	public AbstractItens(Integer flagVisible, String img2ditem,
			Integer minLevel, Integer flagPrize, Integer ntimesUse,
			Integer globalLevel) {
		this.flagVisible = flagVisible;
		this.img2ditem = img2ditem;
		this.minLevel = minLevel;
		this.flagPrize = flagPrize;
		this.ntimesUse = ntimesUse;
		this.globalLevel = globalLevel;
	}

	/** full constructor */
	public AbstractItens(Departament departament, Integer flagVisible,
			String img2ditem, Integer minLevel, Integer flagPrize,
			Integer ntimesUse, Integer globalLevel,
			Set<Languageitem> languageitems, Set<Map> maps,
			Set<Itemrecord> itemrecords) {
		this.departament = departament;
		this.flagVisible = flagVisible;
		this.img2ditem = img2ditem;
		this.minLevel = minLevel;
		this.flagPrize = flagPrize;
		this.ntimesUse = ntimesUse;
		this.globalLevel = globalLevel;
		this.languageitems = languageitems;
		this.maps = maps;
		this.itemrecords = itemrecords;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "idItem", unique = true, nullable = false)
	public Integer getIdItem() {
		return this.idItem;
	}

	public void setIdItem(Integer idItem) {
		this.idItem = idItem;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "idDepartament")
	public Departament getDepartament() {
		return this.departament;
	}

	public void setDepartament(Departament departament) {
		this.departament = departament;
	}

	@Column(name = "flagVisible", nullable = false)
	public Integer getFlagVisible() {
		return this.flagVisible;
	}

	public void setFlagVisible(Integer flagVisible) {
		this.flagVisible = flagVisible;
	}

	@Column(name = "img2DItem", nullable = false, length = 75)
	public String getImg2ditem() {
		return this.img2ditem;
	}

	public void setImg2ditem(String img2ditem) {
		this.img2ditem = img2ditem;
	}

	@Column(name = "minLevel", nullable = false)
	public Integer getMinLevel() {
		return this.minLevel;
	}

	public void setMinLevel(Integer minLevel) {
		this.minLevel = minLevel;
	}

	@Column(name = "flagPrize", nullable = false)
	public Integer getFlagPrize() {
		return this.flagPrize;
	}

	public void setFlagPrize(Integer flagPrize) {
		this.flagPrize = flagPrize;
	}

	@Column(name = "nTimesUse", nullable = false)
	public Integer getNtimesUse() {
		return this.ntimesUse;
	}

	public void setNtimesUse(Integer ntimesUse) {
		this.ntimesUse = ntimesUse;
	}

	@Column(name = "globalLevel", nullable = false)
	public Integer getGlobalLevel() {
		return this.globalLevel;
	}

	public void setGlobalLevel(Integer globalLevel) {
		this.globalLevel = globalLevel;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "itens")
	public Set<Languageitem> getLanguageitems() {
		return this.languageitems;
	}

	public void setLanguageitems(Set<Languageitem> languageitems) {
		this.languageitems = languageitems;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "itenses")
	public Set<Map> getMaps() {
		return this.maps;
	}

	public void setMaps(Set<Map> maps) {
		this.maps = maps;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "itens")
	public Set<Itemrecord> getItemrecords() {
		return this.itemrecords;
	}

	public void setItemrecords(Set<Itemrecord> itemrecords) {
		this.itemrecords = itemrecords;
	}

}